package com.yinhai.activity;



import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.Toast;
/**
 * 暂时没有用 ， 可以删除
 * @author Administrator
 *
 */
public class SystemSetupSoundActivity extends Activity implements OnClickListener  {
	ImageView backIv;
	private RadioGroup sound=null; 
	private RadioButton syssound, nosound;
	private Context context;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.systemsetupsound);
		context = this;
		
		sound=(RadioGroup)findViewById(R.id.sound); 
		syssound=(RadioButton)findViewById(R.id.syssound); 
		nosound=(RadioButton)findViewById(R.id.nosound);
		nosound.setChecked(true);
		backIv = (ImageView)findViewById(R.id.btn_back);
		backIv.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				onBackPressed();
			}
		});
		
		
		
		
		
		
		sound.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { 
            @Override 
            public void onCheckedChanged(RadioGroup group, int checkedId) { 
                // TODO Auto-generated method stub 
                if(checkedId==syssound.getId()){ 
                	//Utils.setSound(context, SoundConstant.SYS_SOUND);
                	Toast.makeText(SystemSetupSoundActivity.this, "操作成功", Toast.LENGTH_SHORT).show();
                } else if(checkedId==nosound.getId()) {
                	//Utils.setSound(context, SoundConstant.NO_SOUND);
                	Toast.makeText(SystemSetupSoundActivity.this, "操作成功", Toast.LENGTH_SHORT).show();
                }
            } 
        });
		
	}


	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		}
	}
	
	@Override
	public boolean dispatchKeyEvent(KeyEvent event) {
	   if(event.getAction()==KeyEvent.ACTION_DOWN&&event.getKeyCode()==KeyEvent.KEYCODE_BACK&&event.getRepeatCount()==0) {
			onBackPressed();
		   return true;
	   }
	   return super.dispatchKeyEvent(event);
	}

}
